'use strict';
import React from 'react';
import { Route, DefaultRoute, hashHistory, IndexRoute, Redirect, IndexLink} from 'react-router';

// 引入单个页面（包括嵌套的子页面）
import home from './pages/backstage/home.js';
import personalInfo from './pages/backstage/setting/personalInfo';
import changePwd from './pages/backstage/setting/changePwd';
import carouselManage from './pages/backstage/carouselManage/carouselManage';
import productManage from './pages/backstage/productManage/productManage';
import productDetail from './pages/backstage/productManage/productDetail';
import staffMember from './pages/backstage/staffMember';
import staffDetail from './pages/backstage/staffDetail';
import typeManage from './pages/backstage/carouselManage/typeManage';
import feedbackList from './pages/backstage/feedback/feedbackList';
import feedbackDetail from './pages/backstage/feedback/feedbackDetail';

// 配置路由
export default (
    <Route path="home" component={home} breadcrumbName="主页">
      <IndexRoute component={personalInfo} breadcrumbName="个人信息"/>
      <Route path="/backstage/personalInfo" breadcrumbName="个人信息" component={personalInfo} />
      <Route path="/backstage/carouselManage" breadcrumbName="轮播图" component={carouselManage}/>
      <Route path="/backstage/productManage" breadcrumbName="商品列表" component={productManage}>
        <Route path="productDetail/:id" breadcrumbName="详情" component={productDetail} />
      </Route>
      <Route path="/backstage/staffMember" breadcrumbName="用户管理" component={staffMember}>
        <Route path="staffDetail/:id" breadcrumbName="详情" component={staffDetail} />
      </Route>
      <Route path="/backstage/feedbackList" breadcrumbName="反馈列表" component={feedbackList}>
        <Route path="feedbackDetail/:id" breadcrumbName="详情" component={feedbackDetail} />
      </Route>
      <Route path="/backstage/changePwd" breadcrumbName="修改密码" component={changePwd} />
      <Route path="/backstage/typeManage" breadcrumbName="类型图" component={typeManage}/>
      {
      // <Redirect from="*" to="/backstage"/>
      }
    </Route>
);
